extends Spatial

onready var star_area : Area = $Area
onready var animation : AnimationPlayer = $AnimationPlayer
onready var sounds = get_tree().get_current_scene().get_node("Sounds")
onready var globalGame = get_tree().get_current_scene()

func on_area_entered(area):
	taken_sound()
	star_area.queue_free()
	#printerr("star taken")
	globalGame.add_star()
	animation.play("star_taken")
	
func _ready():
	#print("starssss")
	globalGame.set_total_stars(globalGame.get_total_stars()+1)
func taken_sound():
	sounds.star_play()
